<template>
	<view class="weight-day">
		<view class="weight-echart">
			<view>
				<text><text class="tap">{{data==null?"-":data.weight}}</text>KG,比前{{data==null?"-":data.dateNumber}}日下降{{data==null?"-":data.number}}KG</text>
				<text class="small">{{time}}</text>
			</view>
			<view class="echart">
				<weightLineVue></weightLineVue>
			</view>
		</view>
		<view class="weight-target">
			<view>
				<image src="/static/index/target.png"></image>
				<text>BMI计算</text>
			</view>
			<view class="weight-content">
				<view class="svg">
					<weightRoateVue></weightRoateVue>
				</view>
				<view class="weight-bmi">
					<view>
						<text class="tap">{{data==null?"-0":data.bmiNumber}}</text>
						<text>BMI</text>
					</view>
					<view>
						<text class="tap">{{data==null?"无":data.level}}</text>
						<text>评级</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import { reactive,ref } from 'vue';
import weightRoateVue from '../../../ucharts/weight/weightRoate.vue';
import weightLineVue from '../../../ucharts/weight/weightLine.vue';

	//数据
	let data=reactive({
		weight:50,
		dateNumber:170,
		number:4,
		bmiNumber:88,
		level:"偏低"
	})
	//获取当前时间
	let now=new Date();
	let time=ref((now.getMonth()+1)+"月"+now.getDate()+"日");

</script>

<style scoped>
	.weight-day {
		paddingr: 0rpx 10rpx 0rpx 10rpx;
		margin-top: 240rpx;
		height: 1300rpx;
		display: flex;
		flex-direction: column;
		flex-wrap: nowrap;
		justify-content: flex-start;
	}

	text {
		margin: 8rpx 0rpx 0rpx 20rpx;
	}

	.weight-echart {
		height: 620rpx;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		margin: 10rpx 20rpx;
		padding-top: 20rpx;
		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
		border-radius: 25rpx;
	}

	.weight-echart view:nth-child(1) {
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
	}

	.small {
		font-size: 24rpx;
		color: #868686;
		margin-left: 40rpx;
	}

	image {
		margin-left: 20rpx;
		width: 50rpx;
		height: 50rpx;
	}

	/* echart图 */
	.echart {
		width:100%;
		height:80%;
	}

	.tap {
		font-size: 44rpx;
	}

	.weight-content {
		width: 100%;
		height:80%;
		display: flex;
		flex-direction:column;
		flex-wrap: nowrap;
		justify-content: flex-start;
	}
	.svg{
		width:100%;
		height:70%;
	}
	.weight-bmi{
		width: 100%;
		height:30%;
		border-top:4rpx solid #d1d1d1 ;
		display: flex;
		flex-direction:row;
		flex-wrap: nowrap;
		justify-content:space-around;
		align-items: center;
	}
	.weight-bmi>view{
		width:50%;
		height:60%;
		text-align: center;
		display: flex;
		flex-direction:column;
		flex-wrap: nowrap;
		justify-content:flex-start;
		margin-bottom:30rpx;
	}
	.weight-bmi>view:nth-child(1){
		border-right:4rpx solid #d1d1d1 ;
	}
	
	.weight-target>view:nth-child(1) {
		width: 100%;
		height: 20%;
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: flex-start;
		border-bottom: 4rpx solid #d1d1d1;
		align-items: center;
	}

	.weight-target image {
		margin-top: 6rpx;
	}

	.weight-target {
		height: 620rpx;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		margin: 10rpx 20rpx;
		padding-top: 20rpx;
		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
		border-radius: 25rpx;
	}
</style>